package lab02.test26;

import java.util.Scanner;

/**
 * Created by lenovo on 2017/11/7.
 */
public class ExceptionTest {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入被除数：");
        int dividend=sc.nextInt();
        System.out.println("请输入除数：");
        int divisor=sc.nextInt();
        double quotient=0;
        try{
            quotient=dividend/divisor;
            System.out.println("两数相除："+quotient);
        }catch (ArithmeticException e){
            System.out.println("除数为0！"+e);
        } finally {
            System.out.println("数字转换的异常处理");
        }
    }
}
